﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administrator/Admin.Master" AutoEventWireup="true"
    CodeBehind="RoleUserManager.aspx.cs" Inherits="ServerApi.administrator.RoleUserManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Title" runat="server">
Phân quyền user
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Script" runat="server">
    <style type="text/css">
        .style1
        {
            width: 150px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <strong style="font-size: 18px; text-transform: uppercase">Phan quyen user</strong>
    </div>
    <br />
    <div>
        <strong>Tìm kiếm</strong>
    </div>
    <div>
        <table>
            <tr>
                <td>
                    Tên quyền:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtNameSearch" Width="150px"></asp:TextBox>
                </td>
                <td style="width: 40px">
                </td>
            </tr>
            <tr>
                <td>
                    Tài khoản:
                </td>
                <td>
                    <asp:DropDownList ID="ddlAccountSearch" runat="server">
                    </asp:DropDownList>
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Trạng thái
                </td>
                <td>
                    <asp:DropDownList ID="ddlStatusSearch" runat="server">
                        <asp:ListItem Value="2">Tất cả</asp:ListItem>
                        <asp:ListItem Value="1">Hoạt động</asp:ListItem>
                        <asp:ListItem Value="0">Không hoạt động</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Tìm kiếm" />
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
    <div style="margin: 10px 0px 4px 0px; border-top: solid 1px red;">
    </div>
    <div>
        <strong>
            <%=title %></strong>
    </div>
    <div>
        <strong>
            <%=message %></strong>
    </div>
    <div>
        <table>
            <tr>
                <td>
                    Loại quyền:
                </td>
                <td>
                    <asp:DropDownList ID="ddlTypeRole" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlTypeRole_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td class="style1">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Tên quyền:
                </td>
                <td>
                    <asp:DropDownList ID="ddlRole" runat="server">
                    </asp:DropDownList>
                </td>
                <td class="style1">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Tài khoản:
                </td>
                <td>
                    <asp:DropDownList ID="ddlAccount" runat="server">
                    </asp:DropDownList>
                </td>
                <td class="style1">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Hoạt động:
                </td>
                <td>
                    <asp:CheckBox ID="chkStatus" runat="server" Checked="True" />
                </td>
                <td class="style1">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnUpdate" runat="server" Text="Cập nhật" OnClick="btnUpdate_Click" />
                </td>
                <td class="style1">
                </td>
            </tr>
        </table>
    </div>
    <div style="margin: 10px 0px 4px 0px; border-top: solid 1px red;">
    </div>
    <div style="width: 100%; text-align: center;">
        <asp:GridView ID="GrvList" DataKeyNames="id" Width="100%" runat="server" AutoGenerateColumns="False"
            PageSize="50" CellPadding="4" ForeColor="#333333" GridLines="Vertical" EnableModelValidation="True"
            OnRowDataBound="GrvList_RowDataBound" OnRowDeleting="GrvList_RowDeleting">
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" HorizontalAlign="center" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:TemplateField HeaderText="STT">
                    <ItemTemplate>
                        <%=stt++ %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input type="checkbox" id="chkAll" onclick="CheckUncheckAll('chk[]',this.checked);" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input type="checkbox" id='chk' name="chk[]" value='<%# Eval("id") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Loại quyền">
                    <ItemTemplate>
                        <%#Eval("typerole")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên quyền">
                    <ItemTemplate>
                        <%#Eval("rolename")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tài khoản">
                    <ItemTemplate>
                        <%#Eval("username")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ToolTip="Xóa" Font-Overline="false" ForeColor="#007FD3" Text="Xóa"
                            CommandArgument='<%#Eval("id") %>' CommandName="Delete" ID="lbtnDel" runat="server">
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <a href='<%#Eval("id","RoleUserManager.aspx?id={0}") %>'>sửa</a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
